import { ServiceProto } from 'tsrpc-proto';
import { ReqUser, ResUser } from './PtlUser';

export interface ServiceType {
    api: {
        "User": {
            req: ReqUser,
            res: ResUser
        }
    },
    msg: {

    }
}

export const serviceProto: ServiceProto<ServiceType> = {
    "version": 2,
    "services": [
        {
            "id": 2,
            "name": "User",
            "type": "api"
        }
    ],
    "types": {
        "PtlUser/ReqUser": {
            "type": "Interface",
            "properties": [
                {
                    "id": 0,
                    "name": "uid",
                    "type": {
                        "type": "Number"
                    }
                }
            ]
        },
        "PtlUser/ResUser": {
            "type": "Interface",
            "extends": [
                {
                    "id": 0,
                    "type": {
                        "type": "Reference",
                        "target": "UserData/UserData"
                    }
                }
            ]
        },
        "UserData/UserData": {
            "type": "Interface",
            "properties": [
                {
                    "id": 0,
                    "name": "uid",
                    "type": {
                        "type": "Number"
                    }
                },
                {
                    "id": 1,
                    "name": "name",
                    "type": {
                        "type": "String"
                    }
                },
                {
                    "id": 2,
                    "name": "head",
                    "type": {
                        "type": "String"
                    }
                },
                {
                    "id": 3,
                    "name": "head_bg",
                    "type": {
                        "type": "String"
                    }
                }
            ]
        }
    }
};